﻿<%@ Page Title="" Language="C#" MasterPageFile="~/cms/cms.master" AutoEventWireup="true" CodeFile="FactList.aspx.cs" Inherits="cms_FactList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
    .top-heading 
    {
        border-bottom: dotted 1px #b5b5b5;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 22px;
        color: #1f81d5;
        line-height: 0px;
        padding-top: 15px;
        padding-bottom: 15px;
        clear: both;
    }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" Runat="Server">
    <h1 class="top-heading">Fact List</h1>
    <div>
        
        Type:
        <asp:DropDownList ID="ddlType" runat="server" 
            DataTextField="TypeName" DataValueField="TypeId" AutoPostBack="True" 
            onselectedindexchanged="ddlType_SelectedIndexChanged">
        </asp:DropDownList>
        
        <br />
        
        <br />

        <asp:Button ID="Button1" runat="server" PostBackUrl="~/cms/AddNewFactList.aspx" 
            Text="Add New" />
        <br />

        <br />
    </div>
    <asp:GridView ID="grvFactList" runat="server" AutoGenerateColumns="False" Width="100%" 
        AllowPaging="True" AllowSorting="True" PageSize="30" 
        onrowcommand="grvFactList_RowCommand">
        <Columns>
            <asp:BoundField DataField="FactListId" HeaderText="FactList Id">
            <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
            <asp:BoundField DataField="FactListDescription" 
                HeaderText="FactList Description" />
            <asp:BoundField DataField="TypeName" HeaderText="Type Name" />
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" Text="Edit" NavigateUrl='<%# "~/cms/AddNewFactList.aspx?FactListId="+Eval("FactListId") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" OnClientClick="return confirm('Do you want to delete this ?');"
                        CommandName="Delete" CommandArgument='<%# Eval("FactListId") %>' Text="Delete"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" 
            Font-Underline="False" Wrap="True" />
    </asp:GridView>
    </asp:Content>

